1. Field of the Invention
The present invention relates to an IC memory card, and, more particularly, to a security function for protecting the data stored in the memory card.
2. Description of the Related Art
As one of the portable semiconductor memory devices, an IC memory card is provided. An IC memory card includes semiconductor storage elements in the form of a card. The IC memory card is mounted to a terminal device such as a personal computer, etc. and widely used as external storage for the terminal device.
FIG. 6 is a perspective view of a conventional IC memory card which follows the standards of Japan Electronic Industry Department Association (hereinafter referred to as "JEIDA"). It shows an IC memory card 1 and a connector 30. A double line of socket contacts 31 with tens of terminals per one line thereof are arranged on the end face of the connector 30. The socket contacts 31 are slots perpendicular in a vertical direction to the end face of the connector 30. The socket contacts 31 include therein terminals electrically connected to semiconductor storage elements in the IC memory. The IC memory card constructed as described above is mounted on the terminal through the connector 30, and electrode terminals projecting on the terminal device connector are fitted to the socket contacts 31 in one-to-one correspondence, and the electrode terminals of the terminal device are thereby electrically connected to the IC memory card, thereby making it possible to pass data between the terminal device and the IC memory card. According to the JEIDA standards, the number of terminals of the connector 30 is 68 at contact pitch of 1.27 mm when the IC memory card 1 has the standard dimensions (54.0 mm.times.85.6 mm .times.3.3 mm).
A common memory for storing an application program, and an attribute memory for storing attribute data of the card 1 (data such as kind, configuration, and capacity of the memory) are provided inside the IC memory card. The common memory is usually a plurality of memory ICs, for example, eight memory ICs S.sub.1 -S.sub.8 each having a storage capacity of 128 Kbytes to form a memory space of totalling 1 Mbyte.
FIG. 7 shows a conceptual memory map of the common memory. Page addressing is adopted to this IC memory card. For example, one of the eight memory ICs (S.sub.1 -S.sub.8) is selected by decoding a 3-bit upper address signal among the 20-bits of the address bus, and the address of the memory IC is selected by a 17-bit lower address signal. In this way, the memory IC has a consecutive memory space from upper address 0-lower address 0 to upper address (2.sup.3 -1)-lower address (2.sup.17 -1). The storage capacity of each of the memory ICs (S.sub.1 -S.sub.8) is 128 Kbytes. Thus, the memory space of the common memory 2 has a storage capacity of 1 Mbyte (128 Kbytes.times.8.)
A method of copying the application data written in such a memory space will be described. FIG. 8 shows a terminal device for copying an IC memory card in which the application data is written (hereinafter referred to as "master card") to an IC memory card having the same or more storage capacity than that of the master card (hereinafter referred to as "copy card".) It shows card slots 15 and 16 which are insertion slots of the master card and the copy card.
First of all, the master card is inserted into the card slot 15 and the copy card is inserted into the card slot 16. Then, a copy command is input from a keyboard of the terminal device. The terminal device reads out the application program written in the master card from the leading address of the memory space of the master card, and writes it in the leading address of the copy card in accordance with read or write operation as described above. This operation is repeated up to the end address of the master card to produce the copy card having the same contents as that of the master card. Such a copying as described above may be easily operated by a copy command of commercially available software for the terminal device.
The application program of the copied IC memory card may be loaded by input of an execution command from the terminal device in the same manner as in the master card. When the application program is executed, the terminal device reads the contents of address to be accessed first, and decodes the application program written in the address and executes the program. And then, based on the result of the decoding, the terminal device reads out, decodes and executes the application program to be accessed next. These operations are repeated to execute the application program.
Conventionally, an IC memory card constructed such that data of the master card cannot be easily read out has been produced. For example, an IC memory card including therein a secret number memory 17 and a collating circuit 18, as shown in FIG. 9 has been produced. Such an IC memory card is inserted into the card slot when copying the data stored therein, and then the secret number 19 is input from the terminal device before reading out the contents of the IC memory card. The secret number 19 and data previously stored in the secret number memory 17 in the IC memory card are collated by the collating circuit 18, and a gate circuit 30 is opened only when they agree with each other. In this way, a communication path 20 is opened and the contents of a data memory 21 are read out to the terminal device.
However, when the secret number of the IC card as described above is leaked in some way, a copy card having a storage capacity of 1 Mbyte or more, which is applicable to the master card and the JEIDA standards and is widely used makes it possible to copy the application program.
The conventional IC memory card constructed as described above has the following problems: an executable copy card may be easily produced; it is difficult to hold the secret of the application program stored in the IC memory card; and a copyright in the program maybe infringed.